// 这个文件只是配置路由,菜单列表在Menu.js中配置

const formatPath = {
  component: resolve => {
    require.ensure(["../container/routerLib/format"], () => {
      resolve(require("../container/routerLib/format"));
    });
  }
};

const routes = [
  {
    path: "/platform",
    name: "平台选择",
    component: resolve => {
      require.ensure(["../container/Platform"], () => {
        resolve(require("../container/Platform"));
      });
    }
  },
  {
    path: "/product",
    name: "产品选择",
    component: resolve => {
      require.ensure(["../container/Product"], () => {
        resolve(require("../container/Product"));
      });
    }
  },
  {
    path: "/main/:productCode",
    component: resolve => {
      require.ensure(["../container/Main"], () => {
        resolve(require("../container/Main"));
      });
    },
    children: [
      {
        path: "",
        // name : 'base',
        component: resolve => {
          require.ensure(["../container/Index"], () => {
            resolve(require("../container/Index"));
          });
        }
      },
      {
        path: "prdConfig/baseInfo",
        name: "/产品配置/基础信息配置",
        component: resolve => {
          require.ensure(["../container/prdConfig/baseInfo"], () => {
            resolve(require("../container/prdConfig/baseInfo"));
          });
        }
      },
      {
        path: "prdConfig/interface",
        name: "/产品配置/接口配置",
        component: resolve => {
          require.ensure(["../container/prdConfig/interface"], () => {
            resolve(require("../container/prdConfig/interface"));
          });
        }
      },
      {
        path: "prdConfig/timing",
        name: "/产品配置/定时任务",
        component: resolve => {
          require.ensure(["../container/prdConfig/timing"], () => {
            resolve(require("../container/prdConfig/timing"));
          });
        }
      },
      {
        path: "handlerLib/list",
        name: "/handler库/列表",
        component: resolve => {
          require.ensure(["../container/handlerLib/list"], () => {
            resolve(require("../container/handlerLib/list"));
          });
        }
      },
      {
        path: "handlerLib/format",
        name: "/handler库/格转",
        ...formatPath
      },
      {
        path: "handlerLib/mock",
        name: "/handler库/mock",
        ...formatPath
      },
      {
        path: "routerLib/list",
        name: "/router库/router列表",
        component: resolve => {
          require.ensure(["../container/routerLib/list"], () => {
            resolve(require("../container/routerLib/list"));
          });
        }
      },
      {
        path: "routerLib/format",
        name: "/router库/router格转",
        ...formatPath
      },
      {
        path: "routerLib/layout/bindCardRouter",
        name: "/router库/router编排",
        component: resolve => {
          require.ensure(["../container/routerLib/layout/bindCardRouter"], () => {
            resolve(require("../container/routerLib/layout/bindCardRouter"));
          });
        }
      },
      {
        path: "zooKeeper/index",
        name: "zooKeeper配置",
        component: resolve => {
          require.ensure(["../container/zooKeeper/index"], () => {
            resolve(require("../container/zooKeeper/index"));
          });
        }
      },
      {
        path: "prdQuery/dataQuery",
        name: "/生产验证查询/数据查询",
        component: resolve => {
          require.ensure(["../container/prdQuery/dataQuery"], () => {
            resolve(require("../container/prdQuery/dataQuery"));
          });
        }
      }
    ]
  }
];

export default routes;
